import urllib.request
from bs4 import BeautifulSoup

responseFile = urllib.request.urlopen("http://www.baidu.com")
responseText = responseFile.read()
soup = BeautifulSoup(responseText)
titleTag = soup.title
print(titleTag)
